package com.jcnet.bizaia.adapter;

import java.util.List;

import com.androidquery.AQuery;
import com.androidquery.callback.ImageOptions;
import com.jcnet.bizaia.App;
import com.jcnet.bizaia.R;
import com.jcnet.bizaia.bean.CityBean;
import com.jcnet.bizaia.bean.CountryBean;
import com.jcnet.bizaia.bean.DicussListForecast;
import com.jcnet.bizaia.bean.MainInfoBean;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.RotateAnimation;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class DiscussYuGaoAdapater extends BaseAdapter {

	private Context context;
	private List<DicussListForecast>yugaoDicussListForecasts;
	public int count;
	 
	public DiscussYuGaoAdapater(Context context, List<DicussListForecast>yugaoDicussListForecasts) {
		super();
		this.context = context;
		this.yugaoDicussListForecasts = yugaoDicussListForecasts;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		count = yugaoDicussListForecasts.size();
		return count;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ViewHolder holder;
        if(convertView == null)
        {
            holder = new ViewHolder();
            convertView = View.inflate(context,R.layout.discuss_yugao_adapter_item, null);
            holder.titleTextView = (TextView)convertView.findViewById(R.id.yugaoTextView);
            holder.imageView = (ImageView)convertView.findViewById(R.id.yugaoImg);
            
            
            convertView.setTag(holder);
        }else
        {
            holder = (ViewHolder)convertView.getTag();
            
        }
        	
        	holder.imageView.setVisibility(View.GONE);
        	holder.titleTextView.setText(yugaoDicussListForecasts.get(position).getTitle()
        			+"\r\n"+yugaoDicussListForecasts.get(position).getHolddate()
        	);
        	
        	//new AQuery(context).id(holder.imageView).image(App.HTTP_PATH+yugaoDicussListForecasts.get(position).getPictureurl(), true, true, 0, 0,null, 0, 9.0f / 16.0f);
        	
        	
		return convertView;
	}

	static class ViewHolder{
		ImageView imageView;
		TextView titleTextView;
	}
}
